import { createMemoryHistory, createRouter } from 'vue-router'

import Login from '../components/Login.vue'
import Main from '../components/Main.vue'
import CommentCheck from  '../view/check/CommentCheck.vue'
import ProductCheck from '../view/check/ProductCheck.vue'
import PublishCheck from '../view/check/PublishCheck.vue'
import UserCheck from '../view/check/UserCheck.vue'
import OperateLog from '../view/log/OperateLog.vue'
import VisitLog from '../view/log/VisitLog.vue'
import OrderManagement from '../view/order/OrderManagement.vue'
import ProductManagement from '../view/products/ProductManagement.vue'
import NoticePublish from '../view/publish/NoticePublish.vue'
import UserReport from '../view/report/UserReport.vue'
import UserManagement from '../view/user/UserManagement.vue'
import FameManagement from '../view/user/FameManagement.vue'
import Category from '../view/products/Category.vue'

const routes = [
    { path: '/',name:"/", meta:{title:"登录",power:10},component: Login },

    { path: '/Main', name:"Main",meta:{title:"管理员主界面",power:10},component: Main ,children:[
            { path: '/UserManagement',name:"UserManagement",meta:{title:"用户管理",power:20},component:UserManagement},
            { path: '/FameManagement',name:"FameManagement",meta:{title:"信誉管理",power:20},component:FameManagement},
            { path: '/ProductManagement',name:"ProductManagement",meta:{title:"商品管理",power:20},component:ProductManagement},
            { path: '/Category',name:"Category",meta:{title:"商品分类管理",power:20},component:Category},
            { path: '/OrderManagement',name:"OrderManagement",meta:{title:"订单管理",power:20},component:OrderManagement},
            { path: '/NoticePublish',name:"NoticePublish",meta:{title:"公告发布",power:20},component:NoticePublish},
            { path: '/CommentCheck',name:"CommentCheck",meta:{title:"评论审核",power:20},component:CommentCheck},
            { path: '/ProductCheck',name:"ProductCheck",meta:{title:"商品审核",power:20},component:ProductCheck},
            { path: '/PublishCheck',name:"PublishCheck",meta:{title:"公告审核",power:20},component:PublishCheck},
            { path: 'UserCheck',name:"UserCheck",meta:{title:"用户审核",power:20},component:UserCheck},
            { path: '/OperateLog',name:"OperateLog",meta:{title:"操作日志",power:20},component:OperateLog},
            { path: '/VisitLog',name:"VisitLog",meta:{title:"访问日志",power:20},component:VisitLog},
            { path: '',name:"UserReport",meta:{title:"网站报告",power:20},component:UserReport},
        ]},
]

const router = createRouter({
    history: createMemoryHistory(),
    routes,
})

export default router;